#include <iostream>
#include <cstdlib>

using namespace std;

template <typename T>
T
factorial(T n)
{
	if (n == 1)
		return 1;
	return n * factorial<T>(n-1);
}

int
main(int argc, char *argv[])
{
	cout << factorial<unsigned long long int>(atoi(argv[1])) << endl;
}
